<!--
 * @Author: Bennty
 * @Date: 2024-07-17 10:11:10
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2024-09-12 14:25:26
 * @Description: 请填写简介
-->
<template>
    <el-dialog v-model="props.visible" title="查看合同详情" width="30%" @close="handleClose" destroy-on-close>
        <el-form>
            <el-row>
                <el-col :span="12">
                    <el-form-item label="客户名称">{{ props.data.customerName }}</el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="剩余时间">
                        <span class="remaining">{{ `${ props.data.remainDays} 天` }}</span>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12">
                    <el-form-item label="合同余额">{{ props.data.contractAmount }}</el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="签约时间">{{ props.data.signDate }}</el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12">
                    <el-form-item label="合同定金">{{ props.data.contractDeposit }}</el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="终止时间">{{ props.data.endDate }}</el-form-item>
                </el-col>
            </el-row>
            <el-form-item label="备注">
                <el-input type="textarea" maxlength="128" show-word-limit diabled></el-input>
            </el-form-item>
            <div class="carousel-container">
                <el-carousel trigger="click" :autoplay="false">
                    <el-carousel-item>
                        <el-image style="width: 400px; height: 565.6px" class="contract-image" :src="props.data.fileUrl" fit="fill"></el-image>
                    </el-carousel-item>
                    <!-- <el-carousel-item>
                        <el-image style="width: 400px; height: 565.6px" class="contract-image" src="http://62.234.191.130:9000/dev/2024/05/15/d90b216401624d3da4fda67ed76a4023.png" fit="fill"></el-image>
                    </el-carousel-item> -->
                </el-carousel>
            </div>
            
            <el-form-item label="合同进度"></el-form-item>
            <el-timeline>
                <el-timeline-item timestamp="2023-12-05">
                    {{ '创建合同 2023-12-05 江泉' }}
                </el-timeline-item>
                <el-timeline-item timestamp="2023-12-05">
                    {{ '编辑合同 2023-12-05 江泉' }}
                </el-timeline-item>
                <el-timeline-item timestamp="2023-12-07">
                    {{ '财务审核 2023-12-07 于文靖' }}
                </el-timeline-item>
                <el-timeline-item timestamp="2023-12-09">
                    {{ '通过审批 2023-12-0 于文靖' }}
                </el-timeline-item>
            </el-timeline>
        </el-form>
        <template #footer>
            <div class="dialog-footer">
                <el-button  type="primary" >确 定</el-button>
                <el-button @click="handleClose">取 消</el-button>
            </div>
        </template>
    </el-dialog>
</template>

<script setup lang="ts">

const props = defineProps(['visible','data']);
const emits = defineEmits(['close']);

console.log(props.data);

const handleClose = ()=>{
    emits('close');
};
</script>

<style lang="scss" scoped>
.carousel-container{
    width:100%;
    display: flex;
    justify-content: center;
}
.el-carousel{
    width: 500px;
    height: calc(500px * 1.414);
    ::v-deep(.el-carousel__container){
        width: 500px;
        height: calc(500px * 1.414);
    }
}
.remaining{
    font-weight: bolder;
}
.contract-image{
    border-radius: 10px;
}
.dialog-footer{
    display:flex;
    justify-content: center;
}
</style>